package com.xuecheng.base.exception;


import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description 学成在线项目异常类
 * @author Mr.M
 * @date 2022/9/6 11:29
 * @version 1.0
 */
@Getter
@AllArgsConstructor
public class XueChengPlusException extends RuntimeException {
   private String errCode;

   private String errMessage;



   public XueChengPlusException() {
      super();
   }

   public XueChengPlusException(String errMessage) {
      super(errMessage);
      this.errMessage = errMessage;
   }





   public static void cast(CommonError commonError){
       throw new XueChengPlusException(commonError.getErrMessage());
   }


   public static void cast(String errMessage){
       throw new XueChengPlusException(errMessage);
   }
   public static void cast(String errCode,String errMessage){
       throw new XueChengPlusException(errCode,errMessage);
   }

}